FROM ubuntu:18.04
#FROM nvcr.io/nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu18.04

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LANG C.UTF-8
ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/openssl/lib:/usr/local/sqlite3/lib:$LD_LIBRARY_PATH
ENV PATH /usr/local/openssl/bin:/usr/local/sqlite3/bin:$PATH


COPY sources.list /etc/apt
RUN apt-get clean && apt-get update && apt-get install -y gcc make perl libffi-dev zlib1g-dev libreadline-dev libbz2-dev liblzma-dev vim curl wget\
   && rm -rf /var/lib/apt/lists/*
COPY . /data/
RUN  cd /data/openssl-1.1.1h && ./config shared --prefix=/usr/local/openssl && make && make install \
  && cd /data/sqlite-3.4.5 && ./configure --prefix=/usr/local/sqlite3 && make && make install \
  && cd /data/Python-3.10.13 && ./configure --with-openssl=/usr/local/openssl --enable-shared; make ;make install \
  && ln -s /usr/local/bin/python3 /usr/bin/python \
  && ln -s /usr/local/bin/pip3 /usr/bin/pip \
  && rm -rf /data
  
  
#--enable-shared 为了生成lib库  libreadline 支持bash交互 perl 为了openssl编译 libffi-dev支持ctype
